package com.yxh.www.author.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统组织-RBAC
 * </p>
 *
 * @author Yangxiaohui
 * @since 2020-05-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SmOrganize extends Model<SmOrganize> {

    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 组织名称
     */
    @TableField("organize_name")
    private String organizeName;

    /**
     * 父级ID
     */
    @TableField("parent_id")
    private String parentId;

    /**
     * 组织状态（0：正常；1：失效）
     */
    @TableField("organize_status")
    private String organizeStatus;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 组织负责人-管理人员-部门主管
     */
    @TableField("admin_user")
    private String adminUser;

    public SmOrganize() {
    }

    public SmOrganize(String organizeName, String parentId, String adminUser) {
        this.organizeName = organizeName;
        this.parentId = parentId;
        this.adminUser = adminUser;
    }

    public SmOrganize(String id, String organizeName,  String organizeStatus, String adminUser) {
        this.id = id;
        this.organizeName = organizeName;
        this.parentId = parentId;
        this.organizeStatus = organizeStatus;
        this.adminUser = adminUser;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
